Developing Applications with Azure Active Directory by Manas Mayank & Mohit Garg

Developing Applications with Azure Active Directory by Manas Mayank & Mohit Garg

Author:Manas Mayank & Mohit Garg
Language: eng
Format: epub
ISBN: 9781484250402
Publisher: Apress


4.Add a button and a textbox in MainWindow.xaml.cs.

5.Clicking the button fetches the access token from Azure AD. Use the following code.private void Button_Click(object sender, RoutedEventArgs e)

{

authContext = new AuthenticationContext(authority);

txtData.Text = "Fetching Data......";

GetData();

}

GetData function internally will call the Azure AD to fetch the access token.AuthenticationResult result = null;

try

{

result = await authContext.AcquireTokenAsync(resourceId, clientId, redirectURI, new PlatformParameters(PromptBehavior.Auto));

}

catch (Exception ex)

{

txtData.Text = "An error occurred.";

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.